#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author Jmz

# type 默认 元类
# class 关键字所在的操作
# 1、 类名


class people:
    sex = 'boby'
    def __init__(self,name,age):
        self.name = name
        self.age= age
    def eat(self):
        print('%s is eating'%self.name)


print(people)
print(people.__dict__)
p1 = people('jmz',12)
print(p1.__dict__)
print('-'*100)




class_name= "people"

class_base = (object,)

class_body ="""
sex = 'boby'
def __init__(self,name,age):
    self.name = name
    self.age = age
    
def eat(self):
    print('%s is eating'%self.name)

"""

class_dic = {}

exec(class_body,{},class_dic)

people = type(class_name,class_base,class_dic)

print(people)
print(people.__dict__)
p1 = people('jmz',12)
print(p1.__dict__)



print('==='*100)

print(type('111'))